package top.iflyoung.cim.biz.service;

import com.baomidou.mybatisplus.extension.service.IService;
import top.iflyoung.cim.biz.entity.ChatLoginStatus;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author liguiyang
 * @description
 * @sine 1.8
 * @date 2021/9/416:44
 **/
public interface ChatLoginStatusService extends IService<ChatLoginStatus> {
    /**
     * 登录
     *
     * @param userId
     * @return
     */
    boolean login(Long userId) throws IllegalArgumentException, NullPointerException;

    /**
     * 下线
     *
     * @param userId
     * @return
     */
    boolean offline(Long userId) throws NullPointerException;

    /**
     * 获取自己的同时的登录次数
     *
     * @param userId
     * @return
     */
    int getSelfOnlineSize(Long userId);
    List<ChatLoginStatus> getStatus(Long userid);
}
